/***
 * 启动子应用
 */
import WujieVue from "wujie-vue2"

const { setupApp, preloadApp } = WujieVue

import { childMap } from "./child-projects-config"
import hostMap from "../utils/hostMap"

const startedAppKey = [childMap.vipRailway] // 预加载项目

const keys = Object.keys(childMap)
keys.forEach((appKey) => {
  if (startedAppKey.includes(appKey)) {
    setupApp({
      name: appKey,
      url: hostMap(appKey),
      exec: true,
      // el: "",
      sync: true,
    })
    preloadApp({
      name: appKey,
    })
  }
})
